const fs = require('node:fs');
const http = require('node:http');


const port = process.argv[2];
const filePath = process.argv[3];

console.log("server start",filePath);
const server = http.createServer(function (req, res) {
  res.writeHead(200, { 'content-type': 'text/plain' })

  const fileReadStream = fs.createReadStream(filePath,{encoding:'utf-8'});
  fileReadStream.pipe(res);
   // 处理请求的逻辑...
});

server.listen(port)
